import MovementCommon from 'code/Core/Common/MovementCommon';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 风暴之锤
 **/
export default class BossSpell_Stombolt extends AbilityBase {
    static instance: BossSpell_Stombolt;
    constructor(id: string = 'Aqd2') {
        super(id);
        BossSpell_Stombolt.instance = this;
        this.init();
        se.onUnitSpellEffect(this.onSpellEffect.bind(this), this.id);
    }
    init() {}
    onMissileReach(p: TargetMissileConfig) {
        DamageSystemInstance.applyWindDamage(p.target, p.caster, 2000);
        StunSystemIntance.stun(p.target, 1, p.caster);
    }
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {
        BossAbilityManagerInstance.text('风暴之锤', source);
        MovementCommon.TargetMissile({
            missile: 'Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl',
            target,
            caster: source,
            speed: 500,
            radian: 0,
            onReach: this.onMissileReach.bind(this),
        });
    }
    onSpellEffect() {
        this.cast(GetSpellTargetX(), GetSpellTargetY(), GetTriggerUnit(), GetSpellTargetUnit());
    }
}
